package com.gx.cn.hospitalmanage.Control;

import com.loopj.android.http.AsyncHttpClient;
import com.loopj.android.http.AsyncHttpResponseHandler;
import com.loopj.android.http.RequestParams;

/**
 * Created by HCQ on 2018/1/23.
 */

public class TwitterRestClient {
  private static final String BASE_URL="http://192.168.43.43:8080/20170112/";
//   private static final String BASE_URL="http://192.168.3.140:8080/20170112/";
//   private static final String BASE_URL="http://192.168.191.1:8080/20170112/";

    private  static AsyncHttpClient client=new AsyncHttpClient();

    public static void get(String url, RequestParams params , AsyncHttpResponseHandler responseHandler){
        client.get(getAbsoluteUrl(url),params,responseHandler);
    }

    public static  void post(String url,RequestParams params,AsyncHttpResponseHandler responseHandler){
        client.post(getAbsoluteUrl(url),params,responseHandler);
    }

    private static String getAbsoluteUrl(String relativeUrl){

        return BASE_URL+relativeUrl;


    }


}
